{% extends 'airshow/base.html' %}

{% block title %}展品信息列表 - 珠海航展数据管理系统{% endblock %}

{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
    <h2>展品信息列表</h2>
</div>

<div class="card mb-4">
    <div class="card-header">
        <h5>筛选条件</h5>
    </div>
    <div class="card-body">
        <form method="get" class="row g-3">
            <div class="col-md-4">
                <label for="area_name" class="form-label">展区</label>
                <select class="form-select" id="area_name" name="area_name">
                    <option value="">所有展区</option>
                    {% for area_name in area_names %}
                        <option value="{{ area_name }}" {% if request.GET.area_name == area_name %}selected{% endif %}>{{ area_name }}</option>
                    {% endfor %}
                </select>
            </div>
            <div class="col-md-4">
                <label for="category" class="form-label">类别</label>
                <select class="form-select" id="category" name="category">
                    <option value="">所有类别</option>
                    {% for category in categories %}
                        <option value="{{ category }}" {% if request.GET.category == category %}selected{% endif %}>{{ category }}</option>
                    {% endfor %}
                </select>
            </div>
            <div class="col-md-4 d-flex align-items-end">
                <button type="submit" class="btn btn-primary">筛选</button>
                {% if request.GET.area_name or request.GET.category %}
                    <a href="{% url 'airshow:exhibit_info_list' %}" class="btn btn-secondary ms-2">清除筛选</a>
                {% endif %}
            </div>
        </form>
    </div>
</div>

<div class="card">
    <div class="card-header">
        <h5>展品信息列表</h5>
    </div>
    <div class="card-body">
        {% if exhibits %}
            <div class="table-responsive">
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>展品ID</th>
                            <th>参展商</th>
                            <th>名称</th>
                            <th>类别</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for exhibit in exhibits %}
                            <tr>
                                <td>{{ exhibit.exhibit_id }}</td>
                                <td>{{ exhibit.exhibitor.name }}</td>
                                <td>{{ exhibit.name }}</td>
                                <td>{{ exhibit.category }}</td>
                            </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
        {% else %}
            <p class="text-center">暂无展品信息数据</p>
        {% endif %}
    </div>
</div>
{% endblock %} 